
<%@ page import="com.googlecode.payroll.Salary" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'salary.label', default: 'Salary')}" />
        <title><g:message code="default.list.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
        </div>
        <div class="body">
		    <p style="height:10px"></p>
			<g:form url="[controller:'salary', action:'calculate']" name="calculateForm">
			    Month(YYYYMM):<g:textField name="month" value="${params?.month}" />
				<input type="submit" value="Calculate" />
 			</g:form>
            <h1><g:message code="default.list.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <div class="list">
                <table>
                    <thead>
                        <tr>
                        
                            <th><g:message code="salary.employee.label" default="Employee" /></th>
                        
                            <g:sortableColumn property="payment" title="${message(code: 'salary.payment.label', default: 'Payment')}" />
                        
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${salaryInstanceList}" status="i" var="salaryInstance">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                        
                            <td>${fieldValue(bean: salaryInstance, field: "employee")}</td>
                        
                            <td>${fieldValue(bean: salaryInstance, field: "payment")}</td>
                        
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
                <g:paginate total="${salaryInstanceTotal}" />
            </div>
        </div>
    </body>
</html>
